<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">投诉建议</block>
		</cu-custom>
				
		<view class="padding flex flex-direction">
			<view class="cu-form-group">
				<view class="title">标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题：</view>
				<input placeholder="请输入标题" name="input" v-model="title" disabled=false></input>
			</view>
		</view>
		
		<view class="padding flex flex-direction">
			<view class="cu-form-group">
				<view class="title">建议内容：</view>
				<textarea @blur="bindTextAreaBlur" auto-height placeholder="请输入内容" v-model="content" disabled=false></textarea>
			</view>
		</view>
		
		<view class="padding flex flex-direction">
			<app-select label="类    型：" v-model="type" placeholder="请选择类型" :dict="plan_type" space :disabled="true"></app-select>
		</view>
		
		<view class="padding flex flex-direction">
			<app-select label="优 先 级：" v-model="priority" placeholder="请选择类型" :dict="priority_type" space :disabled="true"></app-select>
		</view>
		
		
		<view class="padding flex flex-direction">
			<view class="cu-form-group">
				<view class="title">处理意见：</view>
				<textarea @blur="bindTextAreaBlur" auto-height placeholder="暂无反馈" v-model="opinion" disabled=false></textarea>
			</view>
		</view>
		<view class="padding flex flex-direction">
			<button class="cu-btn bg-blue lg"  @click="deleteItem">删除</button>
		</view>
	</view>
</template>

<script>
	const plan_type = [{text:'投诉',value:'0'},{text:'建议',value:'1'}];
	const priority_type = [{text:'0',value:'0'},{text:'1',value:'1'},{text:'2',value:'2'},{text:'3',value:'3'}];
	import appSelect from '@/components/my-componets/appSelect.vue'
	
	 export default {
	 	name: 'complaintSuggestionDetail',
		data() {
			return {
				plan_type,
				priority_type,
				type:"0",
				content: "内容",
				title: "标题",
				opinion: "处理意见",
				priority: "0",
			}
		},
		onLoad: function () { //option为object类型，会序列化上个页面传递的参数
			console.log(this.$Route.query);
			this.type = this.$Route.query.type.toString()
			this.title = this.$Route.query.title
			this.content = this.$Route.query.content
			this.opinion = this.$Route.query.opinion
			this.priority = this.$Route.query.priority.toString()
		},
		methods: {
			deleteItem() {
				console.log(this.$Route.query.id)
				this.$http.delete(`/property/znzfComplaint/delete?id=${this.$Route.query.id}`).then(res => {
					console.log(res)
				})
				this.$router.go(-1)
			},
			bindTextAreaBlur: function (e) {
				console.log(e.detail.value)
			}
		},
		components:{
		    appSelect,
		 },
	 }
</script>

<style lang='scss'>
</style>

